/*
 *  Attacks.h
 *  
 *	Version 1.0
 *  Created by Nicholas Blecha on 9/20/10.
 *  Copyright 2010 Michigan Technological University. All rights reserved.
 *
 */

#ifndef ATTACKS_H
#define ATTACKS_H

#include "renderer.h"
#include "Beam.h"

class Fighter;
/*
 * Any class that contains a method for causing a 
 * Fighter to perform an offensive action
 */
class Attack {
public:
	std::string getDesc();
	std::string getName();
	virtual bool fire()=0;
protected:
	Attack(std::string desc, std::string newName);
	Renderer *rnd;
	Fighter *owner;
private:	
	std::string description;
	std::string name;
};

/*
 * Any class that causes a Fighter to fire a simple 
 * attack. Anything that extends this class should
 * cause a single beam to fire from the fighter with 
 * damage about equal to the fighter's power.
 */
class NormalAttack : public Attack {
public:
	virtual bool fire()=0;
protected:
	NormalAttack(std::string desc, std::string name);
};

/*
 * Any class that causes a Fighter to fire a wider attack
 * than the NormalAttack class. A class that extends this
 * class should fire two or more beams, each with power
 * proportionally less than a comparable normal attack.
 */
class WideAttack : public Attack {
public:
	virtual bool fire()=0;
protected:
	WideAttack(std::string desc, std::string name);
};

/*
 * Any class that causes a Fighter to fire an attack that
 * does not fit as a Normal or Wide attack. Possible uses
 * for classes that extend this class are a very powerful
 * that depletes the user's HP, or firing one of a limited
 * number of missiles.
 */
class SpecialAttack : public Attack {
public:
	virtual bool fire()=0;
	
	/*
	 * Returns the maximum number of uses this weapon may have.
	 * Should be made private by an implementation that does not
	 * have limited uses.
	 */
	int getMaxUses();
	
	/*
	 * Returns the number of uses remaining for this weapon.
	 * Should be made private by an implementation that does not
	 * have limited uses.
	 */
	int getUses();
	
	/*
	 * Adds (addedUses) additional uses to this weapon, and returns
	 * the new number of uses. Should not exceed maxUses. Should be
	 * made private by an implementation that does not have limited
	 * uses.
	 */
	int addUses(int addedUses);
	
	
protected:
	int maxUses;
	int numberOfUses;
	SpecialAttack(std::string desc, std::string name);
};

class StandardNormalAttack : public NormalAttack {
public:
	bool fire();
	StandardNormalAttack(Fighter* own);};

class FastNormalAttack : public NormalAttack {
public:
	bool fire();
	FastNormalAttack(Fighter* own);
};

class StandardWideAttack : public WideAttack {
public:
	bool fire();
	StandardWideAttack(Fighter* own);
};

class MissileAttack : public SpecialAttack {
public:
	bool fire();
	MissileAttack(Fighter* own);
};

class HPDrainAttack : public SpecialAttack {
public:
	bool fire();
	HPDrainAttack(Fighter* own);
private:
	SpecialAttack::getMaxUses;
	SpecialAttack::getUses;
	SpecialAttack::addUses;
};

#endif
